package p270jp.pxv.android.advertisement.presentation.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.FrameLayout;
import com.socdm.p087d.adgeneration.ADG;
import p062c4.ViewBindings;
import p270jp.pxv.android.legacy.model.GoogleNg;
import p325m0.MutabilityOwnership;

/* compiled from: OverlayADGAutoRotationView.kt */
/* renamed from: jp.pxv.android.advertisement.presentation.view.OverlayADGAutoRotationView */
/* loaded from: classes2.dex */
public final class OverlayADGAutoRotationView extends FrameLayout {

    /* renamed from: a */
    public ADG f18841a;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public OverlayADGAutoRotationView(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
        MutabilityOwnership.m3745m(context, "context");
        MutabilityOwnership.m3745m(attributeSet, "attributeSet");
    }

    public void setGoogleNg(GoogleNg googleNg) {
        MutabilityOwnership.m3745m(googleNg, "googleNg");
    }

    public final void setup(String str) {
        MutabilityOwnership.m3745m(str, "locationId");
        View view = this.f18841a;
        if (view != null) {
            removeView(view);
            ADG adg = this.f18841a;
            if (adg != null) {
                ViewBindings.m9831f(adg);
            }
        }
        ADG adg2 = new ADG(getContext());
        adg2.setReloadWithVisibilityChanged(false);
        adg2.setFillerRetry(false);
        adg2.setAdFrameSize(ADG.AdFrameSize.SP);
        adg2.setAdListener(new p312le.OverlayADGAutoRotationView(adg2));
        FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(-2, -2);
        layoutParams.gravity = 17;
        adg2.setLayoutParams(layoutParams);
        this.f18841a = adg2;
        addView(adg2);
        ADG adg3 = this.f18841a;
        MutabilityOwnership.m3747j(adg3);
        adg3.setLocationId(str);
    }
}
